home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / BLSHADOW.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.3 KB  |  86 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // BlazeClass
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #define I asm
  21.  
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23. //
  24. // Shadow()
  25. //
  26. // Shadows a boxed region
  27. //
  28. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.  
  30. void BlazeClass::Shadow(int X,int Y,int Width,int Height)
  31. {
  32.   if (!Width || !Height || X>=WinWide || Y>=WinHigh)
  33.     return;
  34.  
  35.   int ScreenWidth = BlazeClass::QuickWidth;
  36.   int Locator = ((WinY+Y)*ScreenWidth)+((WinX+X)*2);
  37.  
  38.   if (X+Width>=WinWide)
  39.     Width=WinWide-X;
  40.  
  41.   if (Y+Height>=WinHigh)
  42.     Height=WinHigh-Y;
  43.  
  44.   void far *OUTPUT=BlazeClass::OUTPUT;
  45.   I les di,OUTPUT
  46.   I add di,Locator
  47.  
  48.   I mov bx,[Width]
  49.   I mov dx,[Height]
  50.  
  51.   I mov ah,177
  52.   I mov al,8
  53.   I cld
  54.  
  55. looped:
  56.  
  57.   I push di
  58.   I mov cx,bx
  59.  
  60. next:
  61.  
  62.   I cmp [es:di],ah
  63.   I je attributes
  64.   I inc di
  65.   I stosb
  66.  
  67. goagain:
  68.  
  69.   I loop next
  70.   I pop di
  71.   I add di,ScreenWidth
  72.   I dec dx
  73.   I or dx,dx
  74.   I jne looped
  75.  
  76.   return;
  77.  
  78. attributes:
  79.  
  80.   I xor al,al
  81.   I inc di
  82.   I stosb
  83.   I mov al,8
  84.   I jmp goagain
  85. }
  86.